package WinterHomework.day02;

//猴子吃桃，一天吃一半再加1，到第十天就剩一个
public class Demo02 {
    public static void main(String[] args) {
//        int total = 1;
//        int day = 10;
//        for (int i = 10; i > 0; i--) {
//            System.out.println("第" + day + "天，有桃子" + total + "颗");
//            total = (total + 1) * 2;
//            day--;
//        }
//    }
        int sum = 1;
        for (int i = 9; i > 0; i--) {
            sum = (sum + 1) * 2;
        }
        System.out.println(sum);
    }
}
